Attribute VB_Name = "SimpleApplication"
Option Explicit

Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

Private Const ini_file_name = "vsimple.ini"

'Add menu item
Public Sub AddMenuItem(caption As String)
    
End Sub

'goto another form
Sub SwitchForm(cur_f As Form, tar_f As Form)
    Load tar_f
    cur_f.Visible = False
End Sub

Sub Finish()
    End
End Sub

Public Function GetPreference(name As String) As Variant
    Dim n As Integer
    Dim strtemp As String * 255
    n = GetPrivateProfileString(section, Key, "0", strtemp, 255, ini_file_name)
    GetPreference = StrConv(LeftB(StrConv(strtemp, vbFromUnicode), n), vbUnicode)
End Function

Public Sub StorePreference(name As String, value As Variant)
    WritePrivateProfileString section, Key, value, ini_file_name
End Sub
